package com.yupi.yuapiclientsdk;

import com.yupi.yuapiclientsdk.client.YuApiClient;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * @author lkc
 * @version 1.0
 */
@Configuration
@ConfigurationProperties("yuapi.client") //绑定yml文件,前缀
@Data
@ComponentScan //作用是根据定义的扫描路径，把符合扫描规则的类装配到spring容器中
public class YupaiClientConfig {

    private String accessKey;

    private String secretKey;

    @Bean
    public YuApiClient yuApiClient(){
       return new YuApiClient(accessKey,secretKey);
    }
}
